class Time extends egret.DisplayObjectContainer {
    private hourglass:egret.Bitmap;
    private decade:egret.BitmapText;
    public unit:egret.BitmapText;
    
    public constructor(){
        super();

        //沙漏
        this.hourglass = new egret.Bitmap();
        this.hourglass.texture = RES.getRes("hourglass_png");        
        this.hourglass.height = 70;
        this.hourglass.width = this.hourglass.height*(73/113);
        this.hourglass.x = 30;
        this.hourglass.y = 115;
        this.addChild(this.hourglass);

        // 时间：小时部分 00:
        RES.getResByUrl("resource/assets/time_chance.fnt" , this.theDecade , this,RES.ResourceItem.TYPE_FONT);
        RES.getResByUrl("resource/assets/time_chance.fnt" , this.theUnit , this,RES.ResourceItem.TYPE_FONT);

    }

    private theDecade(font:egret.BitmapFont):void{
        this.decade = new egret.BitmapText();
        this.decade.font = font;
        this.decade.scaleX = 0.5;
        this.decade.scaleY = 0.5;
        this.decade.x = this.hourglass.width + this.hourglass.x + 10;
        this.decade.y = 140;
        this.addChild(this.decade);
        this.decade.text = "00:00:";
    }

    public theUnit(font:egret.BitmapFont){
        // 30s倒数：
        this.unit = new egret.BitmapText();
        this.unit.font = font;
        this.unit.scaleX = 0.5;
        this.unit.scaleY = 0.5;
        this.unit.x = this.decade.x + 200;
        this.unit.y = 140;
        this.addChild(this.unit);
        this.unit.text = "30";
   }

}